<?php

namespace app\index\controller;

use think\Controller;
use think\Request;
use think\Db;

class Fulltime extends Controller
{
    public function index()
    {
    	return $this->fetch('fulltime');
    }

    public function fulllist(){
    	$map['status'] = 1;
    	$map['position'] = '全职';
    	$id = request()->get('id');
        if($id){
        	switch ($id){
        		case 2:$map['recagency']="幼儿园";break;
        		case 3:$map['recagency']="小学";break;
        		case 4:$map['recagency']="初中";break;
        		case 5:$map['recagency']="高中";break;
        		case 6:$map['recagency']="培训机构";break;
        		case 7:$map['recagency']="其他";break;
        	}
        }
    	$list = Db::name('jobs')->where($map)->order('id','asc')->cache(true,10)->paginate(10);
    	return json(['data'=>$list->items(),'currentPage'=>$list->currentPage(),'lastPage'=>$list->lastPage()]);
    }
}
